<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link href="css/huikuanjihua.css" rel="stylesheet" type="text/css">
<script src="http://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!-- 引入样式 -->
<link rel="stylesheet"
	href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script type="text/javascript" src="../js/axios.js"></script>
<script type="text/javascript" src="../js/qs.js"></script>
	</head>

	<body class="bg-lightbule modal-open" style="padding-right: 16px;">

		<!--vue的div开始-->
		<div class="boxhuikuan">

			<div tabindex="-1" class="modal fade in" id="popshow_container" role="dialog" aria-hidden="true" aria-labelledby="myModalLabel" style="display: block; z-index: 1052;">
				<div class="modal-dialog modal-xg" style="margin: 0; padding: 0;background: #fff;">
					<div class="modal-content" id="popshow_container_content" style="margin: 0; padding: 0; border-width: 0px; height: 0px;background: #fff;">
						<div class="modal-body " id="popshow" style="margin: 0; padding: 0;background: #fff;">
							<div id="popshowcont" style="margin: 0; padding: 0;background: #fff;">
								<div id="gedit" style="margin: 0; padding: 0;background: #fff;">
									<div id="editgedit" style="position:absolute;background: #fff; display:none;&#9;left:0;&#9;top:0; width:0;&#9;height:0; z-index:100;  "><iframe name="editsubgedit" src="/a.html" scrolling="no" style="width: 0; height: 0; border: 0;"></iframe></div>
									<form name="formedit_gedit" class="form-horizontal" action="/system/editok.xt" enctype="multipart/form-data" method="POST" target="editsubgedit" novalidate="" autocomplete="off" style="background: #fff;"><input name="mdb" type="hidden" value="229789c5a8df3182ad7757f6dc6c7eec"><input name="comname" type="hidden" value="gedit"><input name="db" type="hidden" value="gathering"><input name="retjava" type="hidden" value="b7gsTKoUGZph2X0lGZld2Xkx2biVnLw9GdgsTKoUGdhRGc1JGZu92XrNWasN2X0lGZldmLw9Gd"><input name="type" type="hidden" value="insert"><input name="dt_gathering_id" type="hidden" value=""><input name="dt_gathering_route" type="hidden" value=""><input name="dt_gathering_money_type" type="hidden" value="RMB"><input name="dt_gathering_prj_id" type="hidden" value="0"><input name="dt_gathering_co_id" type="hidden" value="169"><input name="dt_gathering__co_id" type="hidden" value="169"><input name="dt_gathering_money_rate" type="hidden" value="100"><input name="dt_gathering_cu_id" type="hidden" value="107">
										<div style="background: #fff;" class="portlet form-horizontal border-n">
											<div style="background: #fff;" class="portlet-heading portlet-default">
												<div style="background: #fff;" class="pull-right  f-s-12">

													<!--<span class="button_close_qshow"><button type="button" class="btn btn-white waves-effect waves-light" data-dismiss="modal" aria-hidden="true"><i class="fa fa-close m-r-5"></i>关闭</button></span>-->
													<button name="B0" class="btn btn-white waves-effect waves-light" type="submit"><i class="fa fa-check m-r-5"></i><span set-lan="html:保存">保存</span></button>
												</div>
												<h4 class="modal-title text-dark">
            <span set-lan="html:计划回款/应收表">计划回款/应收表</span>
            
        </h4>
												<hr class="border-t-a">

											</div>

											<el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm" style="padding-left: 25px;">
												<div class="gedit_scroll_content">
													<div class="panel-collapse collapse in" id="bg-default">
														<div class="portlet-body p-t-0 p-r-7 BODY_EDIT_SHOW_BOX" style="background: #fff;">
															<div class="row">
																<div class="col-md-12">
																	<div class="form-group ">

																		<!--客户回显-->
																		<el-row :gutter="20">
																			<el-col :span="4">
																				<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">客户:</div>
																			</el-col>
																			<el-col :span="17">
																					<el-input v-model="ruleForm.costomers" disabled :span="16" placeholder="请输入内容"></el-input>
																				
																			</el-col>
																		</el-row>

																	</div>
																</div>
															</div>
															<div class="row">
																<div class="col-md-12">
																	<div class="form-group ">

																		<!--订单-->

																		<el-row :gutter="20">
																			<el-col :span="4">
																				<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">合同/订单:</div>
																			</el-col>
																			<el-col :span="17">
																					<el-input v-model="ruleForm.orders" disabled :span="16" placeholder=""></el-input>
																			
																			</el-col>
																		</el-row>
																		<!--订单-->

																	</div>
																</div>
															</div>

															<div class="row">
																<div class="col-md-12">
																	<div class="form-group ">

																		<!--日期和期次-->

																		<el-row :gutter="20">

																			<!--付款方式-->
																			<!--发货日期-->
																			<el-col :span="4">
																				<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">计划日期:</div>
																			</el-col>
																			<el-col :span="6">
																				
																				<el-input v-model="ruleForm.havetime" disabled :span="16" placeholder="" style="width: 200px;"></el-input>
																			</el-col>

																			<!--对应期次-->
																			<el-col :span="4">
																				<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">期次:</div>
																			</el-col>
																			<el-col :span="6">
																					<el-input v-model="ruleForm.period" disabled :span="16" placeholder="" style="width: 200px;"></el-input>
													
																			</el-col>
																		</el-row>
																		<!--客户回显-->

																	</div>
																</div>
															</div>

															<div class="row">
																<div class="col-md-12">
																	<div class="form-group ">

																		<!--金额百分比和金额-->

																		<el-row :gutter="20">

																			<el-col :span="4">
																				<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">百分比:</div>
																			</el-col>
																			<el-col :span="6">
																				<!--<el-input v-model="orderid" :span="16" placeholder="请输入内容"></el-input>-->
																				<el-form-item prop="percentage">

																					<el-input v-model="ruleForm.percentage" disabled :span="16" placeholder="" style="width: 200px;"></el-input>

																				</el-form-item>
																			</el-col>

																			<!--金额-->
																			<el-col :span="4">
																				<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">金额:</div>
																			</el-col>
																			<el-col :span="6">
																				<el-input v-model="ruleForm.money" disabled :span="16" placeholder="" style="width: 200px;"></el-input>
																			</el-col>
																		</el-row>
																		<!--金额百分比和金额-->

																	</div>
																</div>
															</div>

															<div class="row">
																<div class="col-md-12">
																	<div class="form-group ">

																		<!--是否已开发票，回款方式-->
																		<el-row :gutter="20">
																			<el-col :span="4">
																				<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">是否回款:</div>
																			</el-col>
																			<el-col :span="7">
																				<el-radio-group v-model="ruleForm.status" style="line-height: 40px;height: 40px;">
																					<el-radio :label="2999">已开票</el-radio>
																					<el-radio :label="3000">未开票</el-radio>
																				</el-radio-group>
																			</el-col>
																			
																			<el-col :span="3">
																				<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">回款方式:</div>
																			</el-col>
																			<el-col :span="6">
																				<el-form-item prop="paytypes">
													
													<el-select v-model="ruleForm.paytypes" filterable placeholder="请选择" style="width: 200px;">
    													<el-option :key="3006" label="现金" :value="3006" ></el-option>
    													<el-option :key="3007" label="支票" :value="3007"></el-option>
    													<el-option :key="3008" label="邮政汇款" :value="3008"></el-option>
    													<el-option :key="3009" label="网上银行" :value="3009"></el-option>
  													</el-select>
													
													
												</el-form-item>
																			</el-col>
																		</el-row>
																		<!--是否已开发票-->

																	</div>
																</div>
															</div>

															<div class="row">
																<div class="col-md-12">
																	<div class="form-group ">

																		<!--备注-->
																		<el-row :gutter="20">
																			<el-col :span="4">
																				<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">备注:</div>
																			</el-col>
																			<el-col :span="15">
																				<el-input disabled type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入内容" v-model="ruleForm.deschui" style="width: 510px;margin: 0 auto;">
																				</el-input>
																			</el-col>
																		</el-row>
																		<!--备注-->

																	</div>
																</div>
															</div>

															<div class="row">
																<div class="col-md-12">
																	<div class="form-group ">

																		<!--员工-->

																		<el-row :gutter="20">

																			<el-col :span="4">
																				<div style="vertical-align:middle;margin-bottom: 0;text-align: right;line-height: 40px;height: 40px;">负责人:</div>
																			</el-col>
																			<el-col :span="17">
																					<el-input v-model="ruleForm.user" disabled :span="16" placeholder="" style="width: 510px;"></el-input>
																			</el-col>
																		</el-row>
																		<!--员工-->

																	</div>
																</div>
															</div>

														</div>
													</div>
												</div>
												<div class="text-right p-20">

													<!--<span class="button_close_qshow"><button type="button" class="btn btn-white waves-effect waves-light" data-dismiss="modal" aria-hidden="true"><i class="fa fa-close m-r-5"></i>关闭</button></span>-->
													<button @click="submitForm('ruleForm')" name="B0" class="btn btn-white waves-effect waves-light" type="button"><i class="fa fa-check m-r-5"></i><span set-lan="html:保存">保存</span></button>
												</div>
											</el-form>

										</div>
										<div class="text-center" id="qshow_modal_footer"><input name="B0" type="hidden" value="保存">

											<!--UTF8-->
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>

		</div>

		<script type="text/javascript">
			var vm = new Vue({
				el: ".boxhuikuan",
				data: {
					percentage: "",
					user: "",
					ruleForm: {
						/*备注*/
						deschui:"",
						/*是否开发票*/
						status:2999,
						/*付款方式*/
						paytypes:"",
						/*客戶*/
						costomers: "",
						/*订单*/
						orders: "",
						/*计划日期*/
						havetime: "",
						/*期次*/
						period: "",
						/*百分比*/
						percentage: "",
						/*金额*/
						money: "",
						/*用户*/
						user: "",
						uid:"",
						/*计划id*/
						jid:""

					},
					rules: {
						
						status: [{
							required: true,
							message: '请选择是否开发票',
							trigger: 'change'
						}],
						paytypes: [{
							required: true,
							message: '回款金额不能为空',
							trigger: 'change'
						}]
					}

				},
				methods: {
					submitForm(formName) {
						//验证方法
						this.$refs[formName].validate((valid) => {
							if(valid) {
								//post提交数据
								axios.post("/addBackMoneyEnd",
									//参数转换
									Qs.stringify(this.ruleForm, {
										arrayFormat: 'brackets'
									})
									
								).then(function(v) {
									window.parent.location.href="shozhongordertwo2?oid="+v.data;
								}).catch(function(e) {
									alert("出错了"+e);
								});

							} else {
								console.log('error submit!!');
								return false;
							}
						});
					}
				},
				mounted() {
					//this.restaurants = this.loadAll();

					var backText = ${backEndText};
			        console.log(backText);
					this.ruleForm.cid=backText.cus_id;
					this.ruleForm.oid=backText.o_id;
					this.ruleForm.costomers=backText.cus_name;
					this.ruleForm.orders=backText.otitle;
					this.ruleForm.period=backText.mb_period;
					this.ruleForm.percentage=backText.mb_percentage;
					this.ruleForm.money=backText.mb_moneys;
					this.ruleForm.havetime=backText.mb_date;
					this.ruleForm.user=backText.use_name;
					this.ruleForm.uid=backText.us_id;
					this.ruleForm.deschui=backText.mb_desc;
					this.ruleForm.jid=backText.jid;
				}

			});
		</script>

	</body>

</html>